/**
 * show common manual dps
 *   getElementById, innerHTML
 *   
 * @author panzhibiao@dangdang.com
 * @since 2011-09
 */
// html content
var ddreco_mandps_ifm_html = "";
var ddreco_mandps_find_counter = 0;
// insert HTML to DIV
var ddreco_mandps_add_html_to_div = function() {
	if (ddreco_mandps_find_counter++ > 100) { return; }
	var target_div = document.getElementById(ddreco_mandps_div_id);
	if (!target_div) {
		setTimeout('ddreco_mandps_add_html_to_div()', 1000);
	}
	target_div.innerHTML = ddreco_mandps_ifm_html;
};
// noname function
(function(){
	var _config = {
		'100': [960, 546],
        '200': [780, 546],
		'202': [960, 355],
        '203': [780, 355],
		'201': [780, 315],
		'300': [760, 546]
	};
	var target_url = "http://mandps-api.reco.dangdang.com/?type_id=" + ddreco_mandps_type;
	var ifm = "<iframe allowtransparency=\"true\" frameborder=\"0\" hspace=\"0\" ";
	ifm += ' marginheight="0" marginwidth="0" scrolling="no" vspace="0" ';
	ifm += " width='" + _config[ddreco_mandps_type][0] + "px'";
	ifm += " height='" + _config[ddreco_mandps_type][1] + "px'";
	ifm += " src=\"" + target_url + "\"></iframe>";
	ddreco_mandps_ifm_html = ifm;
	try{
		ddreco_mandps_add_html_to_div();
	}catch(e){}
	
})();
